#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_manpages.dpatch by Mazen Neifer <mazen.neifer@supaero.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: This patch adds man pages to the Lazarus binaries.

@DPATCH@
Index: install/man/man1/lazarus-ide.1
===================================================================
--- lazarus~/install/man/man1/lazarus-ide.1
+++ lazarus/install/man/man1/lazarus-ide.1
@@ -0,0 +1,56 @@
+.TH Lazarus 1 "19 April 2008" "Free Pascal" "Free Pascal RAD IDE"
+.SH NAME
+Lazarus \- is a Rapid Application Development (RAD) for the Free Pascal Compiler (FPC) including an Integrated Development Environment (IDE).
+
+.SH SYNOPSIS
+
+.B "lazarus"
+
+.SH DESCRIPTION
+This binary is an integrated development environment for the
+.I Free Pascal Compiler (FPC)
+which is an advanced
+.I Turbo Pascal
+and
+.I Delphi (7.0) 
+compatible multi-target Pascal compiler.
+.PP
+The IDE uses
+.BR FPC (1)
+.PP
+The current main supported targets are
+.I Linux,
+.I MacOSX,
+.I Freebsd,
+.I MacOS,
+and
+.I Win32.
+The other targets are either based on older
+versions of the compiler or are still in development.
+.PP
+This manpage is meant for quick\-reference only. Lazarus comes with an online manual, which is updated constantly, while this man page can be out of date.
+
+.SH Usage
+
+The user interface of the IDE has been designed to be similar to Delphi.
+It provides the user with a user friendly, but rather powerful editor, a form editor, an extensive on-line help system and a debugger.
+
+A windowing system is the base of the user interface. The user will usually open a few text editor windows in which he will design his program, during which he can regularly check and
+debug through the use of hot keys. The high speed of the compiler ensures that programmers
+can do this often and therefore allows speedy development of code.
+
+.SH Help files
+
+No help files are provided by default. The user must download the Lazarus and Free Pascal documentation
+in HTML format and install it into the IDE using the Help->Configure Help.
+Files can also be installed in this menu and can be useful for source code that ships with HTML files as documentation.
+
+.SH AUTHORS
+Lazarus development team (see 
+.I http://lazarus.freepascal.org
+)
+
+.SH SEE ALSO
+.BR fpc (1)
+.BR startlazarus (1)
+.BR lazbuild (1)
Index: install/man/man1/lazbuild.1
===================================================================
--- lazarus~/install/man/man1/lazbuild.1
+++ lazarus/install/man/man1/lazbuild.1
@@ -0,0 +1,64 @@
+.TH lazbuild 1 "19 April 2008" "Lazarus" "Lazarus Projects Builder"
+.SH NAME
+lazbuild \- The Lazarus projects builder.
+
+.SH SYNOPSIS
+
+.B lazbuild [options]
+
+.SH DESCRIPTION
+
+.B lazbuild
+TO BE FILLED.
+
+.SH USAGE
+
+.B lazbuild
+
+.SH OPTIONS
+.B lazbuild
+has a small number of options to control it's behaviour:
+
+.TP
+.BI "\-h, \-\-help"
+Displays a short help message.
+.TP
+.BI "-B, --build-all"
+build all files of project/package
+.TP
+.BI "-r, --recursive"
+apply build flags (-B) to dependencies too.
+.TP
+.BI "-d, --skip-dependencies"
+do not compile dependencies
+.TP
+.BI "-v, --version"
+show version and exit
+.TP
+.BI " --pcp=<path>, --primary-config-path=<path>"
+primary config directory, where Lazarus stores its config files. Default is /home/mazen/.lazarus
+.TP
+.BI "--scp=<path>, --secondary-config-path=<path>"
+secondary config directory, where Lazarus searches for config template files. Default is /etc/lazarus
+.TP
+.BI "--os=<operating-system>, --operating-system=<operating-system>"
+override the project operating system. e.g. win32 linux.
+.TP
+.BI "--ws=<widgetset>, --widgetset=<widgetset>"
+override the project widgetset. e.g. gtk gtk2 qt win32 carbon.
+.TP
+.BI "--cpu=<cpu>"
+override the project cpu. e.g. i386 x86_64 powerpc powerpc_64 etc.
+.TP
+.BI "--compiler=<ppcXXX>"
+override the default compiler. e.g. ppc386 ppcx64 ppcppc etc.
+.TP
+.BI "--language=<lang>"
+Override language. For example --language=de. For  possible values see files in the languages directory.
+
+.SH SEE ALSO
+.IP 
+.BR lazarus-ide (1)
+.BR fpcmake (1)
+.BR fpc (1)
+.BR make (1)
Index: install/man/man1/startlazarus.1
===================================================================
--- lazarus~/install/man/man1/startlazarus.1
+++ lazarus/install/man/man1/startlazarus.1
@@ -0,0 +1,27 @@
+.TH startlazarus 1 "19 April 2008" "Lazarus" "Lazarus starter"
+.SH NAME
+startlazarus \- starts lazarus program. 
+.B fpdoc.
+
+.SH SYNOPSIS
+
+.B "lazarus"
+
+.SH Description
+
+.B startlazarus
+is used to start the lazarus program. It automatically checks if user
+built a custom lazarus and starts it. And it is used to restart the IDE, when
+the user clicks restart in the IDE.
+
+.SH Usage
+
+You can invoke 
+.B startlazarus
+without any arguments.
+
+.SH SEE ALSO
+.IP 
+.BR lazarys (1)
+.BR lazbuild (1)
+.BR fpc (1)
Index: install/man/Makefile
===================================================================
--- lazarus~/install/man/Makefile
+++ lazarus/install/man/Makefile
@@ -0,0 +1,33 @@
+##################################
+# Man page installation for unix
+#
+
+override PATH:=$(subst \,/,$(PATH))
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+
+
+ifndef INSTALL_PREFIX
+INSTALL_PREFIX=/usr/local
+endif
+
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall,$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install,$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL=
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+
+INSTALL_MANDIR=$(INSTALL_PREFIX)/man
+
+installman:
+	$(GINSTALL) -d -m 755 $(INSTALL_MANDIR)/man1
+#	$(GINSTALL) -d -m 755 $(INSTALL_MANDIR)/man5
+	$(GINSTALL) -c -m 644 man1/*.1 $(INSTALL_MANDIR)/man1
+#	$(GINSTALL) -c -m 644 man5/*.5 $(INSTALL_MANDIR)/man5
